package de.andreavicentini.teatralia.generate;

import org.magiclabs.htmlx.*;
import de.andreavicentini.teatralia.pages.*;
import de.andreavicentini.teatralia.pages.home.*;
import java.util.*;

public class Home implements ITransfx {
  protected static String nl;
  public static synchronized Home create(String lineSeparator)
  {
    nl = lineSeparator;
    Home result = new Home();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = NL + NL + NL + NL + "<table width=80% cellspacing=20 >" + NL + "<tr><td colspan=2>";
  protected final String TEXT_3 = NL;
  protected final String TEXT_4 = NL + "</td></tr>" + NL + "<tr>" + NL + "<td align=center><img src=\"images/1.jpg\" width=300></td>" + NL + "<td align=center><img src=\"images/2.jpg\" width=300></td>" + NL + "<tr><td colspan=2>";
  protected final String TEXT_5 = NL;
  protected final String TEXT_6 = NL + "</td></tr>" + NL + "<tr>" + NL + "</tr>" + NL + "<tr>" + NL + "<td>";
  protected final String TEXT_7 = "</td>" + NL + "<td>";
  protected final String TEXT_8 = "</td>" + NL + "</tr>" + NL + "<tr>" + NL + "<td>";
  protected final String TEXT_9 = "</td>" + NL + "<td>";
  protected final String TEXT_10 = "</td>" + NL + "</tr>" + NL + "</table>" + NL + "</div>" + NL + "</p>" + NL;
  protected final String TEXT_11 = NL;

	public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
      
HomePage page = (HomePage) argument;
TeatraliaSiteModel site = (TeatraliaSiteModel) page.getArea().getSiteModel();

    stringBuffer.append(TEXT_2);
    stringBuffer.append(TEXT_3);
    stringBuffer.append( page.getText(HomePage.Keys.intro) );
    stringBuffer.append(TEXT_4);
    stringBuffer.append(TEXT_5);
    stringBuffer.append( page.getText(HomePage.Keys.intro2) );
    stringBuffer.append(TEXT_6);
    stringBuffer.append( new TeatraliaBigLink(site.members) );
    stringBuffer.append(TEXT_7);
    stringBuffer.append( new TeatraliaBigLink(site.events) );
    stringBuffer.append(TEXT_8);
    stringBuffer.append( new TeatraliaBigLink(site.repertoire) );
    stringBuffer.append(TEXT_9);
    stringBuffer.append( new TeatraliaBigLink(site.galleries) );
    stringBuffer.append(TEXT_10);
    stringBuffer.append(TEXT_11);
    return stringBuffer.toString();
  }
}